<?php

function messageContent() {
	global $message_stack;
	
	if(isset($_SESSION['messageToStack'])) {
		for($i = 0, $n = sizeof($_SESSION['messageToStack']); $i < $n; $i++){
		
			if($_SESSION['messageToStack'][$i]['type'] == 'error')
				$content_message = '<h3>Fehler</h3>'.$_SESSION['messageToStack'][$i]['text'];
			elseif ($_SESSION['messageToStack'][$i]['type'] == 'warning')
				$content_message = '<h3>Warnung</h3>'.$_SESSION['messageToStack'][$i]['text'];
			elseif ($_SESSION['messageToStack'][$i]['type'] == 'success')
				$content_message = '<h3>Erfolg</h3>'.$_SESSION['messageToStack'][$i]['text'];
		}
		unset($_SESSION['messageToStack']);
	}
	
	$c = '<div data-role="page" id="message">
			<div data-role="content" data-theme="a">
				'.$content_message.'	
				<a href="#" data-role="button" data-rel="back" data-theme="b">schliessen</a>
			</div>
		</div><a href="#" data-rel="dialog" id="Popup" style="display:none;">Einsatz geht auf</a>";';
	return $c;
}